CC	= gcc
LD    = gcc

CLIBS   =`pkg-config gtk+-2.0 --libs`
CFLAGS=`pkg-config gtk+-2.0 --cflags`
ALP =  (pkg-config --libs --cflags gtk+-2.0)

OPT	= -Wall -ansi -pedantic -ggdb -lpthread  $(CFLAGS) $(CLIBS)
GDB	= -ggdb -lpthread  $(CLIBS) $(CFLAGS)

SRCS	= main.c client.c structure.c interface.c

#MAIN	= ModeTexte
MAIN	= Modegraphique

ifeq ($(MAIN),  ModeTexte)
	SRCS	= mainTexte.c client.c  processus.c communication.c
	Mon_Executable	= Clienttexte
else
	Mon_Executable	= ClientGraphique
	SRCS	= mainGraphique.c client.c processus.c communication.c interface.c
endif


OBJ_DIR	= bin
SRC_DIR	= src
BIN_DIR	= bin
DOC_DIR	= doc


default: $(BIN_DIR)/$(Mon_Executable)


$(BIN_DIR)/$(Mon_Executable):  $(SRCS:%.c=$(OBJ_DIR)/%.o)
	$(LD) $(GDB) $+ -o $@ 
	
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
	$(CC) -c $(OPT)  $< -o $@ $


clean:
	rm -rf  $(OBJ_DIR)/*.o $(BIN_DIR)/$(Mon_Executable) 

